home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / Gui4Cli / Tools / fastread / FastRead.gc < prev    next >
Encoding:
Gui4CLI script  |  1980-01-03  |  3.1 KB  |  142 lines

  1. G4C
  2.  
  3. winbig -1 -1 240 177 "FastRead.gc"
  4. wintype 11010001
  5. usetopaz
  6. varpath "viewtext.g"
  7.  
  8. xonload
  9. extract fastread.gc guipath fre_path
  10. assign GCHELP: $fre_path
  11. delvar fre_path
  12. ttget gchelp:fastread.gc
  13. guiload gchelp:viewtext.g
  14. ifexists port AREXX
  15.     ;Nop
  16. elseifexists file sys:system/rexxmast
  17.     run 'sys:system/rexxmast >nil:'
  18. else
  19.     ezreq "Can't start ARexx" Okay ""
  20.     assign gchelp: remove
  21.     guiquit viewtext.g 
  22.     guiquit fastread.gc   
  23. endif
  24. reqfile -1 -1 200 -60 'Select A Document' load guide GUIS:Docs/User
  25. if $guide = ''
  26.     assign GCHELP: remove
  27.     guiquit viewtext.g 
  28.     guiquit fastread.gc   
  29. else
  30.     extract guide file list
  31.     appvar list .idx
  32.     joinfile gchelp:idx $list list
  33.     ifexists file c:getnodes
  34.     andifexists file c:writenode
  35.         run 'resident c:getnodes pure add'
  36.         run 'resident c:writenode pure add'
  37.     elseifexists file guis:c/getnodes
  38.     andifexists file guis:c/writenode
  39.         run 'resident guis:c/getnodes pure add'
  40.         run 'resident guis:c/writenode pure add'
  41.     else
  42.         ezreq "Cannot Find Binaries." Okay ""
  43.         gosub fastread.gc exit
  44.     endif
  45.     ifexists file $list
  46.         ;nop
  47.     else
  48.         cli 'getnodes $guide $list'
  49.     endif
  50.     lvuse fastread.gc 1
  51.     lvchange $list
  52.     guiopen fastread.gc
  53.     extract guide file wtitle
  54.     extract wtitle unquote wtitle
  55.     setwintitle fastread.gc "$wtitle                      "
  56. endif
  57.  
  58. xonkey #v
  59. xonkey #r
  60. if $$rawkey.code = 95
  61.     cli 'writenode guis:docs/user/helpsystem.txt 8655 1826'
  62.     guiopen viewtext.g
  63.     set translation off
  64.     lvuse viewtext.g 1
  65.     lvchange ram:guide.txt
  66. elseif $$rawkey.code = 78
  67.     lvuse fastread.gc 1
  68.     lvmove 1
  69. elseif $$rawkey.code = 79
  70.     lvuse fastread.gc 1
  71.     lvmove -1
  72. endif
  73.  
  74. xonclose
  75. gosub fastread.gc exit
  76.  
  77. xtextin 0 0 180 13   "" txt "" 80
  78. if $txt > ''
  79.     lvuse fastread.gc 1
  80.     lvsearch $txt ci first
  81. endif
  82. gosub fastread.gc search_update
  83.  
  84. xbutton 180 0 20 13 ยป
  85. if $txt > ''
  86.    lvuse fastread.gc 1
  87.    lvsearch $txt ci next
  88. endif
  89. gosub fastread.gc search_update
  90.  
  91. xbutton 200 0 40 13 Open
  92. reqfile -1 -1 200 -60 'Select A Document' load doc GUIS:Docs/User
  93. ifexists file $doc
  94.     guide = $doc
  95.     extract guide file list
  96.     appvar list .idx
  97.     joinfile gchelp:idx $list list
  98.     ifexists file $list
  99.         ;nop
  100.     else
  101.         cli 'getnodes $guide $list'
  102.     endif
  103.     lvuse fastread.gc 1
  104.     lvchange $list
  105.     extract guide file wtitle
  106.     extract wtitle unquote wtitle
  107.     setwintitle fastread.gc "$wtitle                      "
  108. endif
  109.  
  110. xlistview 0 13 240 170  '' topic '' 0 txt
  111. gadid 1
  112. gosub fastread.gc fetchtext
  113.  
  114. xroutine fetchtext
  115. cutvar topic cut word -2 offset
  116. extract topic upper topic
  117. extract topic unquote topic
  118. cli 'writenode $guide $offset'
  119. guiopen viewtext.g
  120. update viewtext.g 2 "Subject: $topic"
  121. set translation off
  122. lvuse viewtext.g 1
  123. lvchange ram:guide.txt
  124.  
  125. xroutine search_update
  126. if $$lv.line > ''
  127.    update fastread.gc 1 $$lv.line
  128. else
  129.    lvgo #0
  130.    update fastread.gc 1 0
  131. endif
  132.  
  133. xroutine exit
  134. assign GCHELP: remove
  135. run 'resident getnodes remove'
  136. run 'resident writenode remove'
  137. ifexists file ram:guide.txt
  138.     delete ram:guide.txt
  139. endif
  140. guiquit viewtext.g 
  141. guiquit fastread.gc   
  142.